#ifndef VIEWTRANSFORM_HPP
#define VIEWTRANSFORM_HPP
#include "Mat4.hpp"

class ViewTransform
{
   public:

      ViewTransform() : mWidth(1.0f), mHeight(1.0f), mNearPlane(.1f), mFarPlane(1000.0f) {}

      float mWidth;
      float mHeight;
      Mat4 mProjection;
      Mat4 mRotate;
      Mat4 mTranslate;

      Mat4& GetTransform()
      {
         mTransform = mRotate * mTranslate;
         return mTransform;
      }

      Mat4& GetFullTransform()
      {
         mFullTransform = GetTransform() * mProjection;
         return mFullTransform;
      }

      Mat4& GetFullTransformInverse()
      {
         Mat4& tran = GetFullTransform();
         mInverseFullTransform = tran.inverse();
         return mInverseFullTransform;
      }

      Vec2 Unproject(Vec3 aPoint)
      {
         Vec3 pt = aPoint * GetFullTransform();
         return Vec2(pt.x, pt.y);
      }
      Vec3 Project(Vec2  aPoint,
                   float aDistance)
      {
         Mat4& trans = GetFullTransformInverse();
         return Vec3();
      }
      float mNearPlane;
      float mFarPlane;
   private:
      Mat4 mTransform;
      Mat4 mFullTransform;
      Mat4 mInverseFullTransform;


   private:
      
};
#endif
